//
//  DataModel.m
//  autostainer
//
//  Created by lurenjia on 2017/5/16.
//  Copyright © 2017年 walker. All rights reserved.
//

#import "DataModel.h"
#import "ExperimentModel.h"

@implementation DataModel
- (instancetype)initWithDict:(NSDictionary *)dict {
    if (self = [super init]) {
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}
- (void)setValue:(id)value forKey:(NSString *)key {
    if ([key isEqualToString:@"ExperimentDetails"]) {
        NSArray *temp = (NSArray *)value;
        NSMutableArray *arrM = [NSMutableArray array];
        for (NSDictionary *dic in temp) {
            ExperimentModel *model = [[ExperimentModel alloc]initWithDict:dic];
            [arrM addObject:model];
        }
        self.experimentDetails = arrM.copy;
        return;
    }
    [super setValue:value forKey:key];
}
@end
